import re
import urllib.request
url = "http://tieba.baidu.com/p/2460150866"
response = urllib.request.urlopen(url).read().decode('utf-8')

imglist = re.findall('src="(.+?\.jpg)" pic_ext',response)

x=0
for imgurl in imglist:
    urllib.request.urlretrieve(imgurl, "D:\images\{}.jpg".format(x))
    x = x + 1
    print("第", x ,"张")
print("下载完毕")
